
const mockData = {
  storePos: {
    storePosCode: '@id',
    'hasIt|1': ['是', '否'],
    remark: '@cparagraph'
  },
  store: {
    storeCode: '@integer(0,8)',
    'storeName|+1': ['备件库', '旧件库'],
    'isEnable|+1': ['启用', '停用'],
    'isEnableCode|+1': ['1', '0'],
    'hasPos|1': ['有', '无'],
    'remarkL|1': ['00aa', '00b1']
  }
}

export default [
  {
    url: '/pa/warehousegetstorepos',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(6).fill(mockData.storePos)
      }
    }
  },
  {
    url: '/pa/warehousegetstore',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success',
        'rows': Array(2).fill(mockData.store)
      }
    }
  },
  {
    url: '/pa/savestoredata',
    type: 'post',
    data: {},
    response: config => {
      return {
        'result': '1',
        'msg': 'Success'
      }
    }
  },
  {
    url: '/mp/e3sh/vesale/common/commonListService',
    type: 'post',
    data: {},
    response: config => {
      const { lookupTypeCode } = config.body
      let rows = []
      switch (lookupTypeCode) {
        case 'SE2004':
          rows = [
            { lookupValueCode: '1', lookupValueName: '索赔' },
            { lookupValueCode: '2', lookupValueName: '内部' },
            { lookupValueCode: '3', lookupValueName: '转账' },
            { lookupValueCode: '4', lookupValueName: '现金' },
            { lookupValueCode: '5', lookupValueName: 'APP' },
            { lookupValueCode: '6', lookupValueName: 'POS' },
            { lookupValueCode: '7', lookupValueName: '商城' },
            { lookupValueCode: '11', lookupValueName: '挂账' },
          ]
          break
        case 'SE0022':
          rows = [
            { lookupValueCode: '1', lookupValueName: '索赔' },
            { lookupValueCode: '2', lookupValueName: '内部' },
            { lookupValueCode: '3', lookupValueName: '保险' },
            { lookupValueCode: '4', lookupValueName: '客户' }
          ]
          break
      }
      return {
        'result': '1',
        'msg': 'Success',
        rows
      }
    }
  }
]
